//输出所有的"水仙花数".所谓"水仙花数"是指这样的一个三位数
//输出所有的"水仙花数"(从小到大的顺序输出,一行一个)

#include <stdio.h>
int main ()
{
  int isNarNum(int Num);
  void CalNarNum();
  CalNarNum();
  return 0;
}

int isNarNum(int Num)
{
  int n1, n10, n100;
  int isNN=0;
  if (Num/100>0){ //判断是否是三位数
    n100 = Num/100;
    n10  = (Num-n100*100)/10;
    n1   = (Num-n100*100-n10*10);
    //printf("%d %d %d\n", n100,n10, n1);
    if (n1*n1*n1 + n10*n10*n10 + n100*n100*n100 == Num){
      isNN = 1;
    }
  }
  return isNN;
}

void CalNarNum()
{
  for (int Num = 100; Num<1000;Num++){
    if (isNarNum(Num)){
      printf("%d\n", Num);
    }  
  }
}
